The present invention relates to parity stripe locks, and more specifically, to granular locking of sub-portions (or blocks) of the stripes.
Storage adapters for redundant array of independent disks (RAID) distribute client data across multiple disk drives in order to improve performance and increase data redundancy. RAID levels greater than RAID 0 provide protection against unrecoverable (sector) read errors, as well as whole disk failure. In a RAID 5 or RAID 6 array, if a received write request is too small and cannot be combined with other writes to cover the entire data region of a parity stripe, the write is performed as a delta update (also called a normal parity update). In doing so, the old data is read to obtain a change mask or “delta” between the old and new data. To complete the update, the parity drive(s) for the affected stripe or stripes is updated using the change mask. When a large number of requests are outstanding simultaneously, it is possible for two requests to write data to different locations within a RAID stripe at the same time which would touch the same parity. If allowed to proceed, the simultaneous writes may incorrectly update the parity data. To prevent this, two operations which affect the same region of parity may not be allowed to be performed at the same time. The enforcement of this rule is upheld by a parity stripe lock (PSL).